from config import *
from my_utils import sqoop, hive, mysql, mysql_conn


def get_hive():
    return hive.Hive(hive_db=HIVE_DB)


def get_sqoop_import():
    return sqoop.Sqoop(hive_db=HIVE_DB, **get_properties(SOURCE_MYSQL_PROPERTIES))


def get_sqoop_export():
    return sqoop.Sqoop(mysql_db=MYSQL_DB_ANALY_, **get_properties(MYSQL_PROD105_ROOT_PROPERTIES))


def get_mysql_conn_data_management():
    return mysql_conn.Mysql(mysql_db=MYSQL_DB_DATA_MANAGEMENT, **get_properties(MYSQL_PROD105_ROOT_PROPERTIES))


if __name__ == '__main__':
    print(get_mysql_conn_data_management().fetchall('SHOW TABLES;'))
